package com.xmmj.main.viewmodel.itemviewmodel

import com.xmmj.common.router.RouteNavigator.routeMain
import com.xmmj.baselibrary.base.activity.mvvm.BaseViewModel
import com.xmmj.baselibrary.utils.SP
import com.xmmj.common.constants.IConstants
import android.view.View
import com.xmmj.baselibrary.base.application.BaseApplication
import com.xmmj.main.model.MainModel

class GuideItemViewModel : BaseViewModel<MainModel>() {

    /**
     * 设置是否显示引导页
     *
     * @param show 是否显示
     */
    private fun setShowGuide(show: Boolean) {
        SP(applicationContext).putBoolean(IConstants.SHOW_GUIDE, show)
    }

    /**
     * 点击进入事件
     */
    var clickEnter = View.OnClickListener {
        routeMain()
        setShowGuide(false)
        finishActivity()
    }
}